#include <stdio.h>
#include <unistd.h>

int main(void){
  printf("我是test2,PID是:%d\n",getpid());
  printf("test2准备调用test1...\n");
  char *path = "/home/jay/c-demo-548/day11/test1";
  char *arvg[]={"test1",NULL};
  char *envp[]={NULL};
  int res = execve(path,arvg,envp);
  if(res==-1){
    printf("test2调用test1失败");
    return 1;
  }
  // 若test1执行成功，后面的代码不会执行
  printf("酱油代码路过。。。。\n");
  return 0;
}
